import request from '@/utils/request'

//   登录api
export const userLoginService = (data) => request.post('/user/login', data)

// 注册api
export const userRegisterService = (data) =>
  request.post('/user/register', data)

// 用户基本信息获取
// export const userGetInfoService = () => request.get('/my/userinfo')

// 修改个人信息api
export const userUpdateInfoService = ({ name, gender, className }) =>
  request.put('/user/modify', { className, gender, name })

// 上传图片（头像）
export const uploadPicture = async (file) => {
  const formData = new FormData()
  formData.append('multipartFile', file)
  return await request.put('/user/avatar', formData)
}
